package de.lunaplayer.view.bars;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

@SuppressWarnings("serial")
public class Menubar extends JMenuBar{
	
	private JMenu menuFile;
	private JMenu menuEdit;
	private JMenu menuExtra;
	
	private JMenuItem open;
	private JMenuItem save;
	private JMenuItem exit;
	
	private JMenuItem undo;
	private JMenuItem redo;
	private JMenuItem pref;
	private JMenuItem createPlaylist;
	private JMenuItem internetradio;
	
	private JMenuItem help;
	private JMenuItem update;
	private JMenuItem about;
	
	public Menubar(){
		
		this.menuFile = new JMenu("Datei"); //$NON-NLS-1$
		this.menuEdit = new JMenu("Bearbeiten"); //$NON-NLS-1$
		this.menuExtra = new JMenu("Extras"); //$NON-NLS-1$
		this.open = new JMenuItem("Öffenen"); //$NON-NLS-1$
		this.save = new JMenuItem("Speichern"); //$NON-NLS-1$
		this.exit = new JMenuItem("Beenden"); //$NON-NLS-1$
		this.undo = new JMenuItem("Undo");
		this.redo = new JMenuItem("Redo");
		this.pref = new JMenuItem("Einstellungen"); //$NON-NLS-1$
		this.createPlaylist = new JMenuItem("Erstelle Playlist"); //$NON-NLS-1$
		this.internetradio = new JMenuItem("Internetradio"); //$NON-NLS-1$
		this.help = new JMenuItem("Hilfe"); //$NON-NLS-1$
		this.update = new JMenuItem("Update"); //$NON-NLS-1$
		this.about = new JMenuItem("Über uns"); //$NON-NLS-1$
		initAction();
		buildPanelMn();
	}

	private void initAction() {
		//TODO ActionListener für MenuButtons implementieren
		this.createPlaylist.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent arg0) {
				
			}
		});
		this.pref.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent arg0) {
				
			}
		});
		this.open.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent arg0) {
				
			}
		});
	}

	private void buildPanelMn(){
		
		this.menuFile.add(open);
		this.menuFile.add(save);
		this.menuFile.add(new JSeparator());
		this.menuFile.add(exit);
		this.menuEdit.add(undo);
		this.menuEdit.add(redo);
		this.menuEdit.add(new JSeparator());
		this.menuEdit.add(pref);
		this.menuEdit.add(new JSeparator());
		this.menuEdit.add(createPlaylist);
		this.menuEdit.add(internetradio);
		this.menuExtra.add(help);
		this.menuExtra.add(update);
		this.menuExtra.add(about);
		add(menuFile);
		add(menuEdit);
		add(menuExtra);
	
	}
	

}
